package com.atguigu.tingshu.album.config;

import com.atguigu.tingshu.album.mapper.TrackInfoMapper;
import com.qcloud.vod.VodUploadClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * vod云点播的初始化
 *
 * @author Taeyang
 * @date 2025/4/24
 */
@Configuration
public class VodConfig {

    private final VodConstantProperties vodConstantProperties;

    @Autowired
    public VodConfig(TrackInfoMapper trackInfoMapper, VodConstantProperties vodConstantProperties) {
        this.vodConstantProperties = vodConstantProperties;
    }

    /**
     * 云点播客户端对象的初始化
     *
     * @return 云点播客户端对象
     */
    @Bean
    public VodUploadClient vodUploadClient() {
        // 初始化一个上传客户端对象
        return new VodUploadClient(vodConstantProperties.getSecretId(), vodConstantProperties.getSecretKey());
    }
}
